package com.wanghlme.bookstore.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.wanghlme.bookstore.entity.Tradeitem;
import com.wanghlme.bookstore.service.TradeitemService;
import com.wanghlme.bookstore.mapper.TradeitemMapper;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 订单项信息业务实现类
 *
 * @author WangHailong
 */
@Service
public class TradeitemServiceImpl extends ServiceImpl<TradeitemMapper, Tradeitem>
        implements TradeitemService {

    /**
     * 根据订单 ID 获取该订单的所有订单项信息
     *
     * @param tradeId 订单 ID
     * @return 查询到的订单项列表
     */
    @Override
    public Tradeitem getTradeItemByTradeId(String tradeId) {
        return getOne(new QueryWrapper<Tradeitem>().eq("trade_id", tradeId));
    }
}




